package com.hsj.common.system.dao.impl;

import com.cjxch.supermybatis.core.dao.impl.BaseDaoImpl;
import com.hsj.common.system.dao.ISysMenuDao;
import com.hsj.common.system.entity.SysMenuDo;
import org.springframework.stereotype.Repository;

import java.io.Serializable;


/**
 *  系统菜单 Dao 接口实现类
 *  @Author: Czy
 *  @Date: 2024-01-23 23:03:26
 *  @Email: 314170122@qq.com
 */
@Repository
public class SysMenuDaoImpl extends BaseDaoImpl<SysMenuDo> implements ISysMenuDao {
    @Override
    public Integer deleteMenu(String id) {
        String sql = "delete from t_sys_menu where path like concat((select tt.path from (select tt.path from t_sys_menu tt where tt.id = #{id}) tt), '%')";
        Serializable ret = getBatisSession().createQuery(sql).setParameter("id", id).execute();
        return Integer.valueOf(ret.toString());
    }
}
